import request from '@/utils/request'

// 登录
export const login = data => request.post('/api/login', data)

// 注册
export const register = data => request.post('/api/reg', data)

// 获取用户基本资料
export const getUserInfo = () => request.get('/my/userinfo')

// 更新用户基本资料
export const updateUserInfo = data => request.put(`/my/userinfo?id=${data.id}`, data)

// 更新用户密码
export const updatePwd = data => request.patch('/my/updatepwd', data)

// 更新用户头像
export const updateAvatar = avatar => request.patch('/my/update/avatar', avatar)
